import React from "react";
import { Carousel, WingBlank } from "antd-mobile";
import { CarouselWrap } from "@/components/main/index/styled";
class CarouselSd extends React.Component {
  state = {
    data: [],
    imgHeight: 176
  };
  componentDidMount() {
    setTimeout(() => {
      this.setState({
        data: ["1", "2", "3"]
      });
    }, 100);
  }
  render() {
    // console.log(this.props.slide_list.toJS());
    return (
      <CarouselWrap>
        <WingBlank style={{ margin: "0" }}>
          <Carousel autoplay={true} infinite>
            {this.props.slide_list.map((item, index) => (
              <a href={item.get("url")} key={index}>
                <img
                  key={index}
                  src={item.get("image_url")}
                  alt={item.get("title")}
                  style={{ width: "100%", verticalAlign: "top" }}
                />
              </a>
            ))}
          </Carousel>
        </WingBlank>
      </CarouselWrap>
    );
  }
}

export default CarouselSd;
